func stepTimeoutCustomizeDiff(_ context.Context, diff *schema.ResourceDiff, v interface{}) error {
	buildList := diff.Get("build").([]interface{})
	if len(buildList) == 0 || buildList[0] == nil {
		return nil
	}
	build := buildList[0].(map[string]interface{})
	buildTimeoutString := build["timeout"].(string)

	buildTimeout, err := time.ParseDuration(buildTimeoutString)
	if err != nil {
		return fmt.Errorf("Error parsing build timeout : %s", err)
	}

	var stepTimeoutSum time.Duration = 0
	steps := build["step"].([]interface{})
	for _, rawstep := range steps {
		if rawstep == nil {
			continue
		}
		step := rawstep.(map[string]interface{})
		timeoutString := step["timeout"].(string)
		if len(timeoutString) == 0 {
			continue
		}

		timeout, err := time.ParseDuration(timeoutString)
		if err != nil {
			return fmt.Errorf("Error parsing build step timeout: %s", err)
		}
		stepTimeoutSum += timeout
	}
	if stepTimeoutSum > buildTimeout {
		return fmt.Errorf("Step timeout sum (%v) cannot be greater than build timeout (%v)", stepTimeoutSum, buildTimeout)
	}
	return nil
}
